package com.fzy.auth.action;

import com.fzy.auth.entity.Contact;
import com.fzy.auth.service.ContactService;
import com.fzy.core.BaseAction;
import com.fzy.core.MyValidationAware;
import com.opensymphony.xwork.ModelDriven;
import com.opensymphony.xwork.Preparable;

public class ContactInputAction extends BaseAction implements ModelDriven, 
		MyValidationAware, Preparable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2042848465554272624L;
	Contact contact;
	ContactService contactService;
	String errorDispatch;

	public void prepare() throws Exception {
		errorDispatch = "redirect:contactList.do";
		contact = (Contact)validateId(request.getParameter("id"), Contact.class);
	}

	public void validate() {

	}

	public String execute() throws Exception {
		return "dispatcher:/WEB-INF/jsp/auth/contact-input.jsp";
	}

	public void setContactService(ContactService contactService) {
		this.contactService = contactService;
	}

	public Contact getContact() {
		return contact;
	}

	public Object getModel() {
		return contact;
	}

	public String getErrorDispatch() {
		return errorDispatch;
	}

}
